package com.feicheng.lanniao.mapper.order;

import com.feicheng.lanniao.entity.PayOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {

    /**
     * @param clientId 用户id
     * @param date      订单生产时间
     * @param money     订单消费
     * @param description 订单描述
     * @description 支付成功后插入一条订单
     * @return
     */

    Integer insertOrder(@Param("clientId") Integer clientId,
                        @Param("date") String date,
                        @Param("money") Integer money,
                        @Param("description") String description);


    /**
     * @param clientId 用户Id
     * @description 根据用户Id查询订单列表
     * @return
     */
    List<PayOrder> selectPayOrderListByClientId(@Param("clientId") Integer clientId,
                                                @Param("page") Integer page,
                                                @Param("size") Integer size
                                                );

    /**
     * @param clientId 用户Id
     * @description 根据用户Id查询订单列表条数
     * @return
     */
    Integer selectCountPayOrderListByClientId(@Param("clientId") Integer clientId);



}
